<?php

namespace app\common\model;
/**
 * [Ilike  寺院关注表]
 * @author [C。]
 * @return html
 */
class Ilike extends Base
{
    protected $name = 'ilike';
    /**
     * 根据搜索条件获取列表信息
     */
    public function getList($map, $from=0, $size = 5)
    {
        $order = ['i.id' => 'desc'];
        $join = [
            ['app_member am','am.id = i.memid'],
        ];
        $result =  $this->field('am.id,am.tel,am.username,am.sex,am.city,am.bathday,am.zid,am.addtime')
            ->alias('i')
            ->join($join)
            ->where($map)
            ->limit($from, $size)
            ->order($order)
            ->select();

        return $result;
    }
    /**
     * 根据条件来获取列表的数据的总数
     * @param array $param
     */
    public function getCount($map = []) {
        $join = [
            ['app_member am','am.id = i.memid'],
        ];
        $result =  $this->alias('i')
            ->join($join)
            ->where($map)
            ->count();

        return $result;
    }
}